/**
 * 
 */
package ferran.tomas.dominio;

import java.util.ArrayList;

/**
 * @author Tomas
 *
 */
public class Itinerario {
	private static Itinerario Instancia;
	private ArrayList<Checkpoint> cps;
	
	
	private Itinerario() {
		
	}
	
	public static Itinerario getInstancia() {
		if(Instancia == null) {
			Instancia = new Itinerario();
		}
		return Instancia;
	}

	/**
	 * @param cps the cps to set
	 */
	public void setCps(ArrayList<Checkpoint> cps) {
		this.cps = cps;
	}

	/**
	 * @return the cps
	 */
	public ArrayList<Checkpoint> getCps() {
		return cps;
	}
	
	  @Override public String toString() {
		    StringBuilder result = new StringBuilder();
		    String newLine = System.getProperty("line.separator");

		    result.append( this.getClass().getName() );
		    result.append( " Object {" );
		    result.append(newLine);
		    
		    if(cps != null) {
		    	for(Checkpoint c : cps) {
		    		result.append( c.getClass().getName() );
		    		result.append( " Object {" );
				    result.append(newLine);
		    		result.append(c.toString());
		    		result.append(newLine);
		    	}
		    }
		   
		    result.append("}");

		    return result.toString();
		  }

	
	
}
